package com.jerry.security.controller;

import com.jerry.security.model.ReturnVO;
import com.jerry.security.model.User;
import com.jerry.security.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jerry.Wu
 * @description:
 * @date 2018/8/29 18:53
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController<User, Integer> {

    @Autowired
    private UserService mUserService;

    @GetMapping("/get")
    public ReturnVO getUserByUsername(@RequestParam String username) {
        User user = mUserService.findUserByUsername(username);
        return ReturnVO.OK(user);
    }



}
